package com.htrq.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.core.convert.converter.Converter;

public class DateConvert implements Converter<String, Date> {
	@Override
	public Date convert(String stringDate) {
		SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		try {
			if (stringDate != null && !stringDate.equals("")) {
				return simpleDateFormat.parse(stringDate);
			}
		} catch (ParseException e) {
			e.printStackTrace();
		}
		return null;
	}
}
